<?PHP
 session_start();
 include("admin/include/db.php");

 
 $userId = $_SESSION['user_id'];

 $sqlUser = mysql_query("SELECT * FROM software_user 
									WHERE id = '".intval( $userId)."'");
 $resUser  = mysql_fetch_array($sqlUser);

 if(isset($_REQUEST) && $_REQUEST['action'] != ''){
 	
	
	
	mysql_query("INSERT INTO software_course_payment
						SET 
							user_id			=	'".$_SESSION['user_id']."',
							payment			=	'".$_REQUEST['user_feedetails']."',
							email			=	'".$_REQUEST["user_email"]."',
							first_name		=	'".$_REQUEST["first_name"]."',
							status			=	'N',
							time_id			= unix_timestamp(),
							user_desc  		=	'".$_REQUEST["user_desc"]."'
	");
	
	header("location:payment_module.php?fees=".$_REQUEST['user_feedetails']);
	exit();		
 }
   

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE_WEBSITE?></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script>
function validation(){
	
	var message = '';
	if(document.getElementById("user_email").value == ''){
		alert("Please enter email details");
		return false;	
	}
	if(document.getElementById("first_name").value == ''){
		alert("Please enter first name details");
		return false;	
	}
	
	if(document.getElementById("user_feedetails").value == ''){
		alert("Please enter fee details");
		return false;	
	}

	if(document.getElementById("desc").value == ''){
		alert("Please enter details");
		return false;	
	}

}
</script>
<center>
<form id="form1" name="form1" method="post" action=""  onsubmit="return validation();" >
<div style="background:#179cc1; height:3px">&nbsp;</div>
<div style="width:990px;" align="center">
		<div id="header">
		<?php
    		include("includes/header.php");
   		?>
        </div>
    <div style="margin-top:20px;">
    	 
        <div style="width:100%;float:left; ">
        	<div style="margin-top:20px;">
    	
       <div style="width:85%; margin-left:40px;border:1px solid #000" >
        	<div align="left"  style="background:#000;color:#FFF; font-family:Arial, Helvetica, sans-serif; height:30px; padding-top:10px" >
            	<span  ><strong>&nbsp;Payment</strong></span>
            </div>
            <div class="text1"  align="left" style=" padding-top:18px;">
         		 <div  >	
                    <div style="float:left; width:30%" class="text" >&nbsp;&nbsp;Your Email:</div>
                    <div style="float:left; width:70%" ><input type="text" id="user_email" class="textBox" name="user_email" value="" maxlength="30"   /> </div>
                    <div style=" clear:both" ></div>
                </div>
       		    <div  style="margin-top:10px" >	
                  <div style="float:left; width:30%" class="text" >&nbsp;&nbsp;Your Name:</div>
                    <div style="float:left; width:70%" ><input type="text" id="first_name" class="textBox" name="first_name" value="" maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
       		    <div style="margin-top:10px"  >	
                  <div style="float:left; width:30%" class="text" >&nbsp;&nbsp;Fee Amount</div>
                    <div style="float:left; width:70%" ><input type="text" id="user_feedetails" class="textBox" name="user_feedetails" value=""  maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
                <div style="margin-top:10px"  >	
                  <div style="float:left; width:30%" class="text" >&nbsp;&nbsp;Description</div>
                    <div style="float:left; width:70%" ><input type="text" id="user_desc" class="textBox" name="user_desc" value=""   /> </div>
                    <div style=" clear:both" ></div>
                </div>
       		    <div style="margin-top:10px;margin-bottom:10px;" align="center">	
                  <input type="hidden" id="action" name="action" value="payment"  />
               	  <input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
				 
                </div>
                 
            </div>
        </div>
       
      <div style="clear:both"></div>
    </div>
        	
        </div>
        <div style="clear:both"></div>
    </div>
   </div> 
    <div style="margin-top:23px; margin-bottom:21px" align="center" >
    	<?php
									$sqlAdvertise = mysql_query("SELECT * FROM software_advertise 
																	WHERE 
																		banner_status = 'Y' AND banner = 2
																		ORDER BY RAND()
																		");
									$resAdvertise = mysql_fetch_array($sqlAdvertise);
							
									$imgPath  = 'admin/upload_images/'.$resAdvertise["banner_image"];
									
								?>
								
    </div>
   </div>
   <div id="footer">
  		<?php include("includes/footer.php")?>
   </div>
</div>
	</div>
</center>
</body>
</html>
